var proName = null;
var proContact = null;
var proPhone = null;
var proPhoneFlag = false;
var saveBtn = null;

$(function(){
	proName = $("#proName");
	proContact = $("#proContact");
	proPhone = $("#proPhone");
	saveBtn = $("#save");

	proPhone.on("focus",function(){
		validateTip(proPhone.next(),{"color":"#666666"},"* 请输入手机号",false);
	}).on("blur",function(){
		var patrn=/^(1[0-9][0-9]|15[0-9]|18[0-9])\d{8}$/;
		if(proPhone.val().match(patrn)){
			proPhone.next().css({"color": "green"});
			proPhone.next().html("* √");
		}else{
			proPhone.next().css({"color": "red"});
			proPhone.next().html("* 您输入的手机号格式不正确");
		}
	}).focus();
	
	saveBtn.on("click",function(){
			if(confirm("是否确认提交数据")){
				swal('修改成功！','','success').then(function () {
					$("#providerForm").submit();
				});
			} else {
			swal("请填写正确信息！","","info");
		}
	});
});